package dk.rhok.model;

import java.awt.Color;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class DangerZoneImpl implements DangerZone {

	private Color c;
	private String name = "";
	
	private long timestamp;
	// List to be serialized by gson
	private List<Coordinate> coords = new ArrayList<Coordinate>();

	public DangerZoneImpl() {
		this.timestamp = new Date().getTime();
	}
	
	public DangerZoneImpl(String name) {
		this.name = name;
		this.timestamp = new Date().getTime();
	}

	@Override
	public void addPoint(Coordinate c) {
		coords.add(c);
	}

	@Override
	public ArrayList<Coordinate> getPoints() {
		return (ArrayList)coords;
	}

	@Override
	public void setColor(Color c) {
		this.c = c;
	}

	@Override
	public String getName() {
		return name;
	}

	@Override
	public long timestamp() {
		return timestamp;
	}

	@Override
	public double latitude() {
		return coords.get(0).getLatitude();
	}

	@Override
	public double longitude() {
		return coords.get(0).getLongitude();
	}

	@Override
	public String getType() {
		return "danger_zone";
	}
}
